package animation.wlh.com.animation_demo.basic

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.AdapterView
import android.widget.ArrayAdapter
import animation.wlh.com.animation_demo.R
import kotlinx.android.synthetic.main.activity_basic_anim.*

/**
 * Created by weilh on 2016/1/22.
 */
class BasicAnimationAct : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_basic_anim)
        title = "基础动画"
        list.adapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, arrayOf("平移动画", "透明动画", "旋转动画", "缩放动画", "动画集合"))
        list.onItemClickListener = AdapterView.OnItemClickListener { adapterView, view, i, l ->
            when(i) {
                0 -> startActivity(Intent(this, TranslateAct::class.java))
                1 -> startActivity(Intent(this, AlphaAnimationAct::class.java))
                2 -> startActivity(Intent(this, RotateAnimationAct::class.java))
                3 -> startActivity(Intent(this, ScaleAnimationAct::class.java))
                4 -> startActivity(Intent(this, AnimationSetAct::class.java))
            }
        }
    }
}
